import io.jsonwebtoken.*;

public class Tesy {
    public void jwt(){
        JwtBuilder jwtBuilder = Jwts.builder();
        String jwtToken = jwtBuilder
                //header
                .setHeaderParam("typ","JWT")
                .setHeaderParam("alg","HS256")
                //payload
                .claim("username","jwq")
                .claim("role","admin")
                //signature
                .signWith(SignatureAlgorithm.ES256,"admin")
                .compact();
    }

    public void parse(String token){
        JwtParser jwtParser = Jwts.parser();
        Jws<Claims> claimsJws = jwtParser.setSigningKey("admin").parseClaimsJws(token);
        Claims claims = claimsJws.getBody();

    }
}
